package com.example.springLearning.part14.util;

import org.springframework.stereotype.Component;

import javax.servlet.*;
import java.io.IOException;

//@Component
public class DemoFilter implements Filter {

    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
        try {
            System.out.println("Filter 处理时发生异常");
            throw new RuntimeException();
        } catch (Exception e) {
            //chain.doFilter(request, response);
        }
        chain.doFilter(request, response);
    }
}
